<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../lib/vue.main.js"></script>
</head>

<body>
    <div id="app">
        <!-- 循环普通数组 -->
        <p v-for="(item,i) in list">索引值:{{i}} --- {{item}}</p>
        <br>
        <!-- 循环对象数组 -->
        <p v-for="user in list2">Id:{{user.id}}---名字:{{user.name}}</p>
        <br/>
        <!-- 循环遍历对象 -->
        <p v-for="{val,key,i} in user1">键是:{{val}} --- 值是:{{key}} --- 索引:{{i}}</p>
        <br>
        <!-- 迭代数字 -->
        <p v-for="count in 10">这是第{{count}}循环</p>
    </div>
    <script>
        var vm=new Vue({
           el:'#app',
           data:{
               list :[1,2,3,4,5,6],
               list2: [
                   {id:1,name:'ZS1'},
                   {id:2,name:'ZS2'},
                   {id:3,name:'ZS3'},
                   {id:4,name:'ZS4'},
               ],
               user1:{
                   id:1,
                   name:'蔡徐坤',
                   gender: '女'
               }
           },
           methods:{}
        });
    </script>
</body>

</html>